package cn.hbads.support.error;

import lombok.Getter;

@Getter
public enum CommonErrorType implements ErrorType {
    // support错误码范围 从5000-5200
    CONTEXT_INSTANCE_NOT_INITIALIZED(5000, "容器实例未正确初始化"),
    JSON_NODE_TRANSFER_ERROR(5001, "JsonNode序列化异常"),
    JSON_SERIALIZE_ERROR(5002, "对象序列化异常"),
    JSON_DESERIALIZE_ERROR(5003, "对象反序列化异常"),
    APPLICATION_GET_BEAN_ERROR(5004, "容器获取实例异常"),
    FORMAT_TEMPORAL_ERROR(5005, "格式化日期异常"),
    PARSE_STR_TO_TEMPORAL_ERROR(5006, "解析日期字符串异常"),
    BUILD_HTTP_REQUEST_BODY_ERROR(5007, "构建HTTP请求体异常"),
    HTTP_REQUEST_MODEL_INVALID(5008, "HTTP请求模型非法"),
    HTTP_SEND_AND_PARSE_ERROR(5009, "发送/解析HTTP异常"),
    EXPECT_RESPONSE_TYPE_NULL(5010, "期望的响应类型不能为空"),
    ;

    private final int code;
    private final String errorMsg;

    CommonErrorType(int code, String errorMsg) {
        this.code = code;
        this.errorMsg = errorMsg;
    }
}